package qyf.example.eurekaclientelsaticsearch;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;
import qyf.example.eurekaclientelsaticsearch.controller.ApplicationContextUtils;
import qyf.example.eurekaclientelsaticsearch.controller.MainBusiListeners;
import qyf.example.eurekaclientelsaticsearch.entity.Article;
import qyf.example.eurekaclientelsaticsearch.entity.MyFactoryBean;
import qyf.example.eurekaclientelsaticsearch.repository.ArticleRepository;

@EnableDiscoveryClient
@SpringBootApplication
@Slf4j
public class EurekaClientElsaticsearchApplication {

	public static void main(String[] args) throws Exception {
		SpringApplication application = new SpringApplication(EurekaClientElsaticsearchApplication.class);
		application.addListeners(new MainBusiListeners());
		application.run(args);
		Object bean1 = ApplicationContextUtils.getBean("&myFactoryBean");
		log.info("bean:{}", bean1.getClass().newInstance());
	}

}
